/*
* // +-------------------------------------------------------------------------------------------------
* // |                 有你就好 [ 有节骨乃坚，无心品自端 ]     <http://encoding.wang>
* // +-------------------------------------------------------------------------------------------------
* // |                             独在异乡为异客         每逢佳节倍思亲
* // +-------------------------------------------------------------------------------------------------
* // |                 联系:   <707069100@qq.com>      <http://weibo.com/513778937>
* // +-------------------------------------------------------------------------------------------------
*/

// -----------------------------------------------------------------------------------------------------
// +----------------------------------------------------------------------------------------------------
// |                   ErYang出品 属于小极品          共同学习    共同进步
// +----------------------------------------------------------------------------------------------------
// -----------------------------------------------------------------------------------------------------


package wang.encoding.mroot.mapper.system

import wang.encoding.mroot.common.mapper.SuperMapper
import wang.encoding.mroot.model.entity.system.Rule
import java.math.BigInteger
import java.util.*


/**
 * 权限 Mapper 接口
 *
 * @author ErYang
 */
interface RuleMapper : SuperMapper<Rule> {

    /**
     * 根据角色 id 查询权限
     *
     * @param roleId 角色id
     * @return TreeSet<Rule>
     */
    fun listByRoleId(roleId: BigInteger): TreeSet<Rule>?

    // -------------------------------------------------------------------------------------------------

    /**
     * 根据角色 id 、pid 大于0 查询权限
     *
     * @param roleId 角色id
     * @return TreeSet<Rule>
     */
    fun listByRoleIdAndPidGt0(roleId: BigInteger): TreeSet<Rule>?

    // -------------------------------------------------------------------------------------------------

    /**
     * 根据角色 id 、pid 大于0 查询权限
     *
     * @param roleId 角色id
     * @return List<Rule>
     */
    fun list2RoleByRoleIdAndPidGt0(roleId: BigInteger): List<Rule>?

    // -------------------------------------------------------------------------------------------------

    /**
     * 得到 pid 大于 0、类型小于 4 权限集合
     *
     * @return List<Rule>
     */
    fun listPidGt0AndTypeLt4(): List<Rule>?

    // -------------------------------------------------------------------------------------------------

    /**
     * 得到 pid 大于 0 权限集合
     *
     * @return List<Rule>
     */
    fun listPidGt0(): List<Rule>?

    // -------------------------------------------------------------------------------------------------

    /**
     * 根据 角色 id 和 权限 id 批量新增 角色-权限 表
     *
     * @param map Map<String, Any>
     *
     * @return Int
     */
    fun saveBatchByRoleIdAndRuleIdArray(map: Map<String, Any>): Int?

    // -------------------------------------------------------------------------------------------------

    /**
     * 根据 角色 id 和 权限 id 批量删除 角色-权限 表
     *
     * @param map Map<String, Any>
     *
     * @return Int
     */
    fun removeBatchByRoleIdAndRuleIdArray(map: Map<String, Any>): Int?

    // -------------------------------------------------------------------------------------------------

    /**
     * 根据 角色id 删除 角色-权限
     *
     * @param roleId 角色id
     * @return Int
     */
    fun removeByRoleId(roleId: BigInteger): Int?

    // -------------------------------------------------------------------------------------------------

    /**
     * 根据 角色id 删除 角色-权限
     *
     * @param map Map<String, Any>
     * @return Int
     */
    fun removeByRoleIdArray(map: Map<String, Any>): Int?

    // -------------------------------------------------------------------------------------------------

    /**
     * 根据 pid 查询 权限集合
     *
     * @param map  Map<String, Any>
     * @return List<Rule>
     */
    fun listByPidArray(map: Map<String, Any>): List<Rule>?

    // -------------------------------------------------------------------------------------------------

}

// -----------------------------------------------------------------------------------------------------

// End RuleMapper class

/* End of file RuleMapper.kt */
/* Location: ./src/main/kotlin/wang/encoding/mroot/mapper/RuleMapper.kt */

// -----------------------------------------------------------------------------------------------------
// +----------------------------------------------------------------------------------------------------
// |                           ErYang出品 属于小极品  O(∩_∩)O~~   共同学习    共同进步
// +----------------------------------------------------------------------------------------------------
// -----------------------------------------------------------------------------------------------------
